<%@ page import="gdepot.Goods" %>

<%@ page import="gdepot.Goods" %>

<script>
	$('input[id=lefile]').change(function() {
		$('#photoCover').val($(this).val());
	});
</script>

<div class="form-group">
	<label for="category" class="col-lg-2 control-label">目录<span class="required-indicator">*</span>
	</label>
	<div class="col-lg-10">
	<g:select id="category" name="category.id" from="${gdepot.Category.list()}" optionKey="id" required="" optionValue="categoryName" value="${goodsInstance?.category?.id}" class="form-control"/>
	</div>
</div>

<div class="form-group">

	<label for="title" class="col-lg-2 control-label">标题<span class="required-indicator">*</span></label>
	<div class="col-lg-10">
	<g:textField name="title" required="" value="${goodsInstance?.title}" class="form-control"/>
	</div>

</div>

<div class="form-group">

	<label for="description" class="col-lg-2 control-label">描述<span class="required-indicator">*</span></label>
	<div class="col-lg-10">
	<g:textArea id="description" name="description" class="form-control">${fieldValue(bean: goodsInstance,field: 'description') }</g:textArea>
	</div>
%{--<g:textField name="description" required="" value="${goodsInstance?.description}"/>--}%

</div>

<div class="form-group">
	<label for="description" class="col-lg-2 control-label">图片<span class="required-indicator">*</span></label>
	%{--<g:textField name="photoUrl" value="${goodsInstance?.photoUrl}"/>--}%
	<div class="col-lg-10">
	<input id="photoCover" name="photoUrl" class="form-control" type="text" value="${goodsInstance?.photoUrl} ">
	<a class="btn" onclick="$('input[id=pictureUrl]').click();">浏览</a>
	<input type= "file" id= "pictureUrl" name= "pictureUrl" class="form-control"  onchange="$('#photoCover').val($(this).val());" style="display: none"/>
</div>
</div>

<div class="form-group">
	<label for="price" class="col-lg-2 control-label">价格<span class="required-indicator">*</span></label>
	<div  class="col-lg-10">
	<g:textField name="price" value="${fieldValue(bean: goodsInstance, field: 'price')}" class="form-control" required=""/>
	</div>

</div>

<div class="form-group ">
	<label for="price" class="col-lg-2 control-label">作者<span class="required-indicator">*</span></label>
	<div class="col-lg-10">
	<g:textField name="author" value="${goodsInstance?.author}" class="form-control"/>
	</div>

</div>

<div class="form-group">
	<label for="price" class="col-lg-2 control-label">出版社<span class="required-indicator">*</span></label>
	<div class="col-lg-10">
	<g:textField name="publish" value="${goodsInstance?.publish}"  class="form-control"/>
	</div>

</div>


%{--<div class="form-group">--}%

	%{--<label for="price" class="col-lg-2 control-label">创建时间<span class="required-indicator">*</span></label>--}%
	%{--<g:datePicker name="createdDate" precision="day"  value="${goodsInstance?.createdDate}"  />--}%
%{--</div>--}%


%{--<div class="form-group">--}%
	%{--<label for="price" class="col-lg-2 control-label">修改时间<span class="required-indicator">*</span></label>--}%
	%{--<g:datePicker name="modifiedDate" precision="day"  value="${goodsInstance?.modifiedDate}"  />--}%
%{--</div>--}%
<g:hiddenField name="user.id" value="${session.user.id}"/>

%{--<div class="form-group">
	<label for="price" class="col-lg-2 control-label">上传者<span class="required-indicator">*</span></label>
	<g:select id="user" name="user.id" from="${gdepot.User.list()}" optionKey="id" required="" value="${goodsInstance?.user?.id}" class="many-to-one"/>
</div>--}%

